package Demo;

import java.util.function.*;
import java.util.function.Function;
import java.util.function.Supplier;

public class Demo40 {
    public static void main(String[] args) {
        Function<String, Boolean> fun = "xxxx"::startsWith;
        fun.apply("x");
        System.out.println(fun.apply("2"));
        Consumer<String> fun2 = System.out::print;
        fun2.accept("0");
        System.out.println();
        String name = "ll";
        Supplier<String> fun3 = name::toUpperCase;
        System.out.println(fun3.get());


    }
}

@FunctionalInterface
interface function_40<P, R> {
    R apply(P p);
}
